import Vue from 'vue'
import axios from 'axios'

import App from './App'
import router from './router'
import store from './store'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import VueMarquee from 'vue-marquee-component'
import VueResize from 'vue-resize'
import 'vue-resize/dist/vue-resize.css'
import waves from '@/directive/waves' // 水波纹指令
import bus from './bus'
import watermark from 'vue-watermark-directive'

import {library} from '@fortawesome/fontawesome-svg-core'
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
import {
  faBarcode,
  faCalendar,
  faCar,
  faChartPie,
  faCogs,
  faCoins,
  faCreditCard,
  faGifts,
  faIdCard,
  faList,
  faShoppingCart,
  faSignOutAlt,
  faStore,
  faSync,
  faTags,
  faUndo,
  faUsers,
  faUserSecret,
  faYenSign
} from '@fortawesome/free-solid-svg-icons'

import {faAlipay, faWeixin} from '@fortawesome/free-brands-svg-icons'

library.add(faUserSecret)
library.add(faCoins)
library.add(faChartPie)
library.add(faSync)
library.add(faGifts)
library.add(faCreditCard)
library.add(faUsers)
library.add(faSignOutAlt)
library.add(faWeixin)
library.add(faAlipay)
library.add(faBarcode)
library.add(faIdCard)
library.add(faYenSign)
library.add(faCar)
library.add(faShoppingCart)
library.add(faCogs)
library.add(faStore)
library.add(faTags)
library.add(faUndo)
library.add(faCalendar)
library.add(faList)

Vue.component('font-awesome-icon', FontAwesomeIcon)
Vue.use(ElementUI)
Vue.use(VueMarquee)
Vue.use(VueResize)
Vue.use(waves)
Vue.use(watermark)

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
Vue.config.productionTip = false
Vue.prototype.$bus = bus
if (process.env.NODE_ENV === 'production') {
  console.log = function () {
  }
}

/* eslint-disable no-new */
new Vue({
  components: {App},
  router,
  store,
  template: '<App/>'
}).$mount('#app')
